.class public Lcom/instagram/android/g/b;
.super Ljava/lang/Object;
.source "FacebookAccount.java"


# static fields
.field private static a:Lcom/facebook/a/b;

.field private static b:Z


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 44
    const/4 v0, 0x0

    sput-object v0, Lcom/instagram/android/g/b;->a:Lcom/facebook/a/b;

    return-void
.end method

.method public static a()Lcom/facebook/a/b;
    .locals 2

    .prologue
    .line 50
    sget-object v0, Lcom/instagram/android/g/b;->a:Lcom/facebook/a/b;

    if-nez v0, :cond_0

    .line 51
    new-instance v0, Lcom/facebook/a/b;

    invoke-static {}, Lcom/instagram/android/g/i;->a()Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Lcom/facebook/a/b;-><init>(Ljava/lang/String;)V

    sput-object v0, Lcom/instagram/android/g/b;->a:Lcom/facebook/a/b;

    .line 52
    invoke-static {}, Lcom/instagram/android/g/b;->l()V

    .line 54
    :cond_0
    sget-object v0, Lcom/instagram/android/g/b;->a:Lcom/facebook/a/b;

    return-object v0
.end method

.method static synthetic a(Lcom/instagram/android/d/b/c;Ljava/lang/String;)Lcom/instagram/android/d/b/c;
    .locals 1
    .parameter
    .parameter

    .prologue
    .line 29
    invoke-static {p0, p1}, Lcom/instagram/android/g/b;->b(Lcom/instagram/android/d/b/c;Ljava/lang/String;)Lcom/instagram/android/d/b/c;

    move-result-object v0

    return-object v0
.end method

.method public static a(Landroid/content/Context;)V
    .locals 2
    .parameter

    .prologue
    .line 244
    new-instance v0, Lcom/instagram/android/g/e;

    invoke-direct {v0, p0}, Lcom/instagram/android/g/e;-><init>(Landroid/content/Context;)V

    const/4 v1, 0x0

    new-array v1, v1, [Ljava/lang/Void;

    invoke-virtual {v0, v1}, Lcom/instagram/android/g/e;->c([Ljava/lang/Object;)Lcom/instagram/d/a;

    .line 245
    return-void
.end method

.method public static a(Lcom/instagram/android/d/b/c;)V
    .locals 1
    .parameter

    .prologue
    .line 146
    invoke-static {}, Lcom/instagram/android/g/b;->a()Lcom/facebook/a/b;

    move-result-object v0

    invoke-virtual {v0}, Lcom/facebook/a/b;->c()Ljava/lang/String;

    move-result-object v0

    invoke-static {p0, v0}, Lcom/instagram/android/g/b;->b(Lcom/instagram/android/d/b/c;Ljava/lang/String;)Lcom/instagram/android/d/b/c;

    .line 147
    return-void
.end method

.method public static a(Lcom/instagram/android/model/c;)V
    .locals 3
    .parameter

    .prologue
    .line 277
    invoke-static {}, Lcom/instagram/android/g/b;->p()Landroid/content/SharedPreferences;

    move-result-object v0

    invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    .line 278
    const-string v1, "page_access_token"

    invoke-virtual {p0}, Lcom/instagram/android/model/c;->a()Ljava/lang/String;

    move-result-object v2

    invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;

    .line 279
    const-string v1, "page_id"

    invoke-virtual {p0}, Lcom/instagram/android/model/c;->b()Ljava/lang/String;

    move-result-object v2

    invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;

    .line 280
    const-string v1, "page_name"

    invoke-virtual {p0}, Lcom/instagram/android/model/c;->c()Ljava/lang/String;

    move-result-object v2

    invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;

    .line 281
    invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z

    .line 282
    return-void
.end method

.method private static a(Ljava/lang/String;Ljava/lang/String;)V
    .locals 1
    .parameter
    .parameter

    .prologue
    .line 129
    new-instance v0, Lcom/instagram/android/g/c;

    invoke-direct {v0, p0, p1}, Lcom/instagram/android/g/c;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-virtual {v0}, Lcom/instagram/android/g/c;->a()V

    .line 135
    return-void
.end method

.method public static a(Z)V
    .locals 1
    .parameter

    .prologue
    .line 58
    if-eqz p0, :cond_0

    .line 59
    invoke-static {}, Lcom/instagram/android/g/b;->o()V

    .line 63
    :cond_0
    invoke-static {}, Lcom/instagram/android/g/b;->p()Landroid/content/SharedPreferences;

    move-result-object v0

    invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->clear()Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z

    .line 66
    invoke-static {}, Lcom/instagram/android/g/b;->j()V

    .line 68
    invoke-static {}, Lcom/instagram/b/a;->a()Lcom/instagram/b/c;

    move-result-object v0

    invoke-interface {v0}, Lcom/instagram/b/c;->b()V

    .line 69
    return-void
.end method

.method private static b(Lcom/instagram/android/d/b/c;Ljava/lang/String;)Lcom/instagram/android/d/b/c;
    .locals 2
    .parameter
    .parameter

    .prologue
    .line 139
    const-string v0, "fb_access_token"

    invoke-virtual {p0, v0, p1}, Lcom/instagram/android/d/b/c;->a(Ljava/lang/String;Ljava/lang/String;)V

    .line 140
    const-string v0, "share_to_facebook"

    const-string v1, "1"

    invoke-virtual {p0, v0, v1}, Lcom/instagram/android/d/b/c;->a(Ljava/lang/String;Ljava/lang/String;)V

    .line 141
    const-string v0, "fb_has_publish_actions"

    const-string v1, "1"

    invoke-virtual {p0, v0, v1}, Lcom/instagram/android/d/b/c;->a(Ljava/lang/String;Ljava/lang/String;)V

    .line 142
    return-object p0
.end method

.method public static b()V
    .locals 5

    .prologue
    .line 83
    invoke-static {}, Lcom/instagram/android/g/b;->p()Landroid/content/SharedPreferences;

    move-result-object v0

    invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    .line 85
    invoke-static {}, Lcom/instagram/android/g/b;->m()Z

    move-result v1

    .line 86
    const-string v2, "access_token"

    invoke-static {}, Lcom/instagram/android/g/b;->a()Lcom/facebook/a/b;

    move-result-object v3

    invoke-virtual {v3}, Lcom/facebook/a/b;->c()Ljava/lang/String;

    move-result-object v3

    invoke-interface {v0, v2, v3}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;

    .line 87
    const-string v2, "access_expires"

    invoke-static {}, Lcom/instagram/android/g/b;->a()Lcom/facebook/a/b;

    move-result-object v3

    invoke-virtual {v3}, Lcom/facebook/a/b;->d()J

    move-result-wide v3

    invoke-interface {v0, v2, v3, v4}, Landroid/content/SharedPreferences$Editor;->putLong(Ljava/lang/String;J)Landroid/content/SharedPreferences$Editor;

    .line 88
    const-string v2, "last_access_update"

    invoke-static {}, Lcom/instagram/android/g/b;->a()Lcom/facebook/a/b;

    move-result-object v3

    invoke-virtual {v3}, Lcom/facebook/a/b;->e()J

    move-result-wide v3

    invoke-interface {v0, v2, v3, v4}, Landroid/content/SharedPreferences$Editor;->putLong(Ljava/lang/String;J)Landroid/content/SharedPreferences$Editor;

    .line 89
    invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z

    .line 91
    invoke-static {}, Lcom/instagram/service/a;->a()Lcom/instagram/service/a;

    move-result-object v0

    invoke-virtual {v0}, Lcom/instagram/service/a;->d()Z

    move-result v0

    if-eqz v0, :cond_1

    .line 92
    if-eqz v1, :cond_0

    .line 93
    invoke-static {}, Lcom/instagram/android/g/b;->d()V

    .line 99
    :cond_0
    :goto_0
    invoke-static {}, Lcom/instagram/android/g/b;->f()V

    .line 100
    return-void

    .line 96
    :cond_1
    invoke-static {}, Lcom/instagram/android/g/b;->n()V

    goto :goto_0
.end method

.method public static c()Z
    .locals 1

    .prologue
    .line 112
    sget-boolean v0, Lcom/instagram/android/g/b;->b:Z

    return v0
.end method

.method public static d()V
    .locals 2

    .prologue
    .line 120
    const/4 v0, 0x0

    sput-boolean v0, Lcom/instagram/android/g/b;->b:Z

    .line 121
    const-string v0, "fb/store_token/"

    invoke-static {}, Lcom/instagram/android/g/b;->a()Lcom/facebook/a/b;

    move-result-object v1

    invoke-virtual {v1}, Lcom/facebook/a/b;->c()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/instagram/android/g/b;->a(Ljava/lang/String;Ljava/lang/String;)V

    .line 122
    return-void
.end method

.method public static e()Ljava/lang/String;
    .locals 3

    .prologue
    const/4 v0, 0x0

    .line 163
    invoke-static {}, Lcom/instagram/android/g/b;->a()Lcom/facebook/a/b;

    move-result-object v1

    invoke-virtual {v1}, Lcom/facebook/a/b;->b()Z

    move-result v1

    if-eqz v1, :cond_0

    .line 164
    invoke-static {}, Lcom/instagram/android/g/b;->p()Landroid/content/SharedPreferences;

    move-result-object v1

    const-string v2, "user_id"

    invoke-interface {v1, v2, v0}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 166
    :cond_0
    return-object v0
.end method

.method public static f()V
    .locals 2

    .prologue
    .line 171
    invoke-static {}, Lcom/instagram/android/g/b;->a()Lcom/facebook/a/b;

    move-result-object v0

    invoke-virtual {v0}, Lcom/facebook/a/b;->b()Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-static {}, Lcom/instagram/android/g/b;->e()Ljava/lang/String;

    move-result-object v0

    if-nez v0, :cond_0

    .line 172
    new-instance v0, Lcom/instagram/android/g/d;

    const/4 v1, 0x0

    invoke-direct {v0, v1}, Lcom/instagram/android/g/d;-><init>(Lcom/instagram/android/g/c;)V

    const/4 v1, 0x0

    new-array v1, v1, [Ljava/lang/Void;

    invoke-virtual {v0, v1}, Lcom/instagram/android/g/d;->c([Ljava/lang/Object;)Lcom/instagram/d/a;

    .line 174
    :cond_0
    return-void
.end method

.method public static g()V
    .locals 2

    .prologue
    .line 252
    invoke-static {}, Lcom/instagram/android/g/b;->p()Landroid/content/SharedPreferences;

    move-result-object v0

    invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    .line 253
    const-string v1, "page_access_token"

    invoke-interface {v0, v1}, Landroid/content/SharedPreferences$Editor;->remove(Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;

    .line 254
    const-string v1, "page_name"

    invoke-interface {v0, v1}, Landroid/content/SharedPreferences$Editor;->remove(Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;

    .line 255
    const-string v1, "page_id"

    invoke-interface {v0, v1}, Landroid/content/SharedPreferences$Editor;->remove(Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;

    .line 256
    invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z

    .line 257
    return-void
.end method

.method public static h()Lcom/instagram/android/model/c;
    .locals 4

    .prologue
    .line 264
    new-instance v0, Lcom/instagram/android/model/c;

    invoke-direct {v0}, Lcom/instagram/android/model/c;-><init>()V

    .line 265
    invoke-static {}, Lcom/instagram/android/g/b;->p()Landroid/content/SharedPreferences;

    move-result-object v1

    .line 266
    const-string v2, "page_access_token"

    const-string v3, ""

    invoke-interface {v1, v2, v3}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/instagram/android/model/c;->a(Ljava/lang/String;)V

    .line 267
    const-string v2, "page_name"

    const-string v3, ""

    invoke-interface {v1, v2, v3}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/instagram/android/model/c;->c(Ljava/lang/String;)V

    .line 268
    const-string v2, "page_id"

    const-string v3, ""

    invoke-interface {v1, v2, v3}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/instagram/android/model/c;->b(Ljava/lang/String;)V

    .line 269
    return-object v0
.end method

.method public static i()Z
    .locals 2

    .prologue
    .line 273
    invoke-static {}, Lcom/instagram/android/g/b;->p()Landroid/content/SharedPreferences;

    move-result-object v0

    const-string v1, "page_access_token"

    invoke-interface {v0, v1}, Landroid/content/SharedPreferences;->contains(Ljava/lang/String;)Z

    move-result v0

    return v0
.end method

.method public static j()V
    .locals 1

    .prologue
    .line 285
    const/4 v0, 0x0

    sput-object v0, Lcom/instagram/android/g/b;->a:Lcom/facebook/a/b;

    .line 286
    return-void
.end method

.method static synthetic k()Landroid/content/SharedPreferences;
    .locals 1

    .prologue
    .line 29
    invoke-static {}, Lcom/instagram/android/g/b;->p()Landroid/content/SharedPreferences;

    move-result-object v0

    return-object v0
.end method

.method private static l()V
    .locals 7

    .prologue
    const-wide/16 v5, 0x0

    .line 72
    invoke-static {}, Lcom/instagram/android/g/b;->p()Landroid/content/SharedPreferences;

    move-result-object v0

    .line 73
    const-string v1, "access_token"

    const/4 v2, 0x0

    invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    .line 74
    const-string v2, "access_expires"

    invoke-interface {v0, v2, v5, v6}, Landroid/content/SharedPreferences;->getLong(Ljava/lang/String;J)J

    move-result-wide v2

    .line 75
    const-string v4, "last_access_update"

    invoke-interface {v0, v4, v5, v6}, Landroid/content/SharedPreferences;->getLong(Ljava/lang/String;J)J

    move-result-wide v4

    .line 77
    if-eqz v1, :cond_0

    .line 78
    sget-object v0, Lcom/instagram/android/g/b;->a:Lcom/facebook/a/b;

    invoke-virtual/range {v0 .. v5}, Lcom/facebook/a/b;->a(Ljava/lang/String;JJ)V

    .line 80
    :cond_0
    return-void
.end method

.method private static m()Z
    .locals 4

    .prologue
    .line 103
    const/4 v0, 0x0

    .line 104
    invoke-static {}, Lcom/instagram/android/g/b;->p()Landroid/content/SharedPreferences;

    move-result-object v1

    const-string v2, "access_token"

    const/4 v3, 0x0

    invoke-interface {v1, v2, v3}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    .line 105
    if-eqz v1, :cond_0

    invoke-static {}, Lcom/instagram/android/g/b;->a()Lcom/facebook/a/b;

    move-result-object v2

    invoke-virtual {v2}, Lcom/facebook/a/b;->c()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-nez v1, :cond_1

    .line 106
    :cond_0
    const/4 v0, 0x1

    .line 108
    :cond_1
    return v0
.end method

.method private static n()V
    .locals 1

    .prologue
    .line 116
    const/4 v0, 0x1

    sput-boolean v0, Lcom/instagram/android/g/b;->b:Z

    .line 117
    return-void
.end method

.method private static o()V
    .locals 2

    .prologue
    .line 125
    const-string v0, "fb/clear_token/"

    invoke-static {}, Lcom/instagram/android/g/b;->a()Lcom/facebook/a/b;

    move-result-object v1

    invoke-virtual {v1}, Lcom/facebook/a/b;->c()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/instagram/android/g/b;->a(Ljava/lang/String;Ljava/lang/String;)V

    .line 126
    return-void
.end method

.method private static p()Landroid/content/SharedPreferences;
    .locals 1

    .prologue
    .line 150
    const-string v0, "facebookPreferences"

    invoke-static {v0}, Lcom/instagram/m/b/a/a;->a(Ljava/lang/String;)Landroid/content/SharedPreferences;

    move-result-object v0

    return-object v0
.end method
